package com.Bigbluebook.Service;

import com.Bigbluebook.entity.Comment;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;

public interface CommentService {
    @POST("comments")
    Call<Comment> createComment(@Body Comment comment);

    @GET("comments/{id}")
    Call<Comment> getComment(@Path("id") int commentId);

    @GET("posts/{postId}/comments")
    Call<List<Comment>> getAllCommentsForPost(@Path("postId") int postId);

    @PUT("comments/{id}")
    Call<Comment> updateComment(@Path("id") int commentId, @Body Comment comment);

    @DELETE("comments/{id}")
    Call<Void> deleteComment(@Path("id") int commentId);

    @GET("comments/userId/{userId}")
    Call<List<Comment>> getAllCommentsByUser(@Path("userId") int userId);
}
